home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
fortran
/
libry51.zip
/
LIBRY6.DOC
< prev
next >
Wrap
Text File
|
1989-11-10
|
11KB
|
264 lines
.pa
PLOT
These procedures enable you to do graphics from FORTRAN. If you just want to
make a plot or draw a figure I suggest you use TPLOT. Considering all of the
options and procedures necessary to turn out a piece of graphics, I wouldn't
recommend your writing your own plot package unless you have some very
unusual, specific task in mind. TPLOT is fairly extensive and has many
options and is quite a lengthy code that took several years to debug.
There is only one function common to all graphics devices and that's drawing a
line between two points. I do everything with lines, including drawing
characters. This might not look too good on a low resolution device; but
it's the only thing you can count on when somebody comes out with a new
device. It is also the only way you can get enhancements like bigger or
smaller and taller or fatter. Besides, by definition, that's all a pen
plotter will do; and that's what I'm most interested in - producing plots for
reports.
Plots in absolute raster units. The lower left-hand corner is (0,0).
These plot procedures work according to the prescribed device (designated by
an LU number). Each type of graphics device requires different commands.
These procedures are designed so that this is transparent. You just specify
the LU and the rest is handled for you. The LUs are as follows.
for this device use....................................this LU
HP-2623 B&W graphics terminal (low resolution)........... 2623
HP-2627 color graphics terminal (low resolution)......... 2623
HP-2648 B&W graphics terminal (low resolution)........... 2648
Tektronix-4014 graphics terminal (high resolution)....... 4014
Tektronix-4107 graphics terminal (medium resolution)..... 4107
HP-7470 two pen plotter (very high resolution)........... 7470
HP-7475 four pen plotter (very high resolution).......... 7475
HP-7550 eight pen plotter (very high resolution)......... 7475
HP-9872 six pen plotter (very high resolution)........... 9872
PC-CGA 320X200 3-colors (very low resolution)............ 8086
PC-HGA 720X348 B&W Hercules (low resolution)............. 186
PC-EGA 640X350 15-colors (low resolution)................ 286
PC-QGA 640X400 Compaq monochrome (low resolution)........ 386
PC-VGA 640X400 15-colors (low resolution)................ 486
(note: the 186,286, etc. has nothing to do with the processor)
I just can't pass up this opportunity to say something about resolution and
color... Anyone who calls 1024X1024 pixels "high resolution" is nuts. High
resolution is at least 4096X3112 pixels. Some people actually call terminals
with 512X360 pixels high resolution - this is probably an inside joke that I'm
just not aware of.
There is also the matter of "how many colors"... Black is not a color because
any terminal can display black when the plug is removed. White is also not a
"color" per se. Colors are red, blue, etc. It really doesn't make a hoot of
difference whether or not you can select from over 10 zillion colors if all
you can get at any one time is 14+white.
.pa
QUICK LIST OF PLOT SUBROUTINES
ARROW.... draw an arrowhead
BOX...... draw a box
CIRCL.... draw a circle (or part of a circle)
COLOR.... change color or pen
DUMPIT... dump the graphics buffer
LINE0.... draw a line
NUMBS.... draw a number
PATRN.... fill in a pattern
PL0TS.... set/get flags
QUITS.... terminate plot
SETBUF... set buffer size
START.... initiate plot
SYMB0.... draw a symbol
SYMBS.... draw a string of symbols
WIPE..... clear graphics
.pa
NAME: ARROW
PURPOSE: draw an arrowhead
TYPE: subroutine (far external)
SYNTAX: CALL ARROW(IX,IY,ISIZE,ANGLE,LU)
INPUT: IX,IY (INTEGER*2) location of tip in raster units
ISIZE (INTEGER*2) length in raster units
ANGLE (REAL*4) angle in degrees (zero is horizontal, 90 is up)
LU (INTEGER*2) see above list
OUTPUT: none
NAME: BOX
PURPOSE: draw a box
TYPE: subroutine (far external)
SYNTAX: CALL BOX(MINX,MINY,MAXX,MAXY,LU)
INPUT: MINX,MINY,MAXX,MAXY (INTEGER*2) location of lower left and
upper right corners of box in raster units
LU (INTEGER*2) see above list
OUTPUT: none
NAME: CIRCL
PURPOSE: draw a circle (or part of a circle)
TYPE: subroutine (far external)
SYNTAX: CALL CIRCL(IX,IY,IR,IDEG1,IDEG2,LU)
INPUT: IX,IY (INTEGER*2) location of center in raster units
IR (INTEGER*2) radius in raster units
IDEG1,IDEG2 (INTEGER*2) degrees where to start and end arc
(for a full circle use 0,360)
LU (INTEGER*2) see above list
OUTPUT: none
NAME: COLOR
PURPOSE: change color or pen
TYPE: subroutine (far external)
SYNTAX: CALL COLOR(IC,LU,IOPT)
INPUT: IC (INTEGER*2) desired color or pen
LU (INTEGER*2) see above list
IOPT (INTEGER*2) option (if IOPT=0 select color, if IOPT<0
select old color-1, if IOPT>0 select old color+1)
OUTPUT: none
NAME: DUMPIT
PURPOSE: dump the graphics buffer
TYPE: subroutine (far external)
SYNTAX: CALL DUMPIT(LU)
INPUT: LU (INTEGER*2) see above list
OUTPUT: none
NAME: LINE0
PURPOSE: draw a line
TYPE: subroutine (far external)
SYNTAX: CALL LINE0(IX1,IY1,IX2,IY2,LT,LU)
INPUT: IX1,IY1 (INTEGER*2) starting point in raster units
IX2,IY2 (INTEGER*2) ending point in raster units
LT (INTEGER*2) linetype (2 is solid, see TPLOT manual)
LU (INTEGER*2) see above list
OUTPUT: none
NAME: NUMBS
PURPOSE: draw a number
TYPE: subroutine (far external)
SYNTAX: CALL NUMBS(IX,IY,ISIZE,ASPECT,ANGLE,SLANT,NSHADE,R,ND,NP,LU)
INPUT: IX,IY,ISIZE,ASPECT,ANGLE,SLANT,NSHADE (see SYMB0)
R (REAL*4) number to be drawn
ND,NP (INTEGER*2) number of digits, number of decimal points
(this is just like an Fn.m format - F10.0 would be 10,0 - for
integer output use R=FLOAT(I) and NP=-1, e.g. for an I5 format
use 5,-1)
LU (INTEGER*2) see above list
OUTPUT: none
NAME: PATRN
PURPOSE: fill in a pattern
TYPE: subroutine (far external)
SYNTAX: CALL PATRN(IX,IY,NP,SL,NS,LT,LU)
INPUT: IX,IY (INTEGER*2) set of points defining polygonal region in
raster units
NP (INTEGER*2) number of points (for a triangular region NP=3)
SL (REAL*4) slope of the lines (tangent of the angle, zero is
horizontal)
NS (INTEGER*2) spacing between lines in raster units (note: if
you want to outline the region set NS=-NS)
LT (INTEGER*2) line type (2 is solid, refer to TPLOT manual
for other line types)
LU (INTEGER*2) see above list
OUTPUT: none
NOTE: this will fill any irregular convex/concave polygonal region
NAME: PL0TS (note zero "0" not oh "O")
PURPOSE: set/get flags
TYPE: subroutine (far external)
SYNTAX: CALL PL0TS(IOPT,I,J,L)
INPUT: IOPT (INTEGER*2) option
IOPT=1 set device=I LU=J
IOPT=2 return J=LU for device=I
IOPT=3 set IXOLD=I,IYOLD=J
IOPT=4 return I=IXOLD,J=IYOLD
IOPT=5 set ALTER=L
IOPT=6 return L=ALTER
IOPT=7 set TILT=L
IOPT=8 return L=TILT
IOPT=9 set IOVCOL=I
IOPT=10 return I=IOVCOL
I,J (INTEGER*2) depending on IOPT
L (LOGICAL*2) depending on IOPT
OUTPUT: J,L depending on IOPT
NOTE: TILT and ALTER are LOGICAL*2 switches that control the plot
orientation (TILT=.FALSE. is upright, TILT=.TRUE. is 90 on
its side) and special character interpretation respectively
refer to TPLOT manual for examples of TILT and ALTER
NAME: QUITS
PURPOSE: terminat